package metrics

import (
	"github.com/prometheus/client_golang/prometheus"
	"strconv"
)

var ServerRequestTotal = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name: "server_api_request",
		Help: "Number of Server requests in total",
	},
	[]string{"api","code"},
)

func init() {
	prometheus.MustRegister(ServerRequestTotal)
}
func IncrServerRequest(api string,code int32){
	codeStr := strconv.Itoa(int(code))
	ServerRequestTotal.With(prometheus.Labels{"api":api,"code":codeStr}).Inc()
}